Skip to content

Fix Android video recording: color pipeline + RVCCA build guard#319

Merged
doranteseduardo merged 2 commits intoReactVision:mainfrom
tadjik1:fix/android-recording-color-and-perf
Apr 27, 2026
Merged

Fix Android video recording: color pipeline + RVCCA build guard#319
doranteseduardo merged 2 commits intoReactVision:mainfrom
tadjik1:fix/android-recording-color-and-perf

Conversation

@tadjik1
Copy link
Copy Markdown
Contributor

@tadjik1 tadjik1 commented Apr 22, 2026

1. Video recording color output & throughput
On Tensor/Mali the encoder-input EGL surface tagged as sRGB caused color_transfer=iec61966-2-1 mis-tagging and ~10 fps throttling from per-write gamma. Exynos ignored the flag so this only surfaced on Pixel/Tensor. Drops the flag, applies gamma explicitly for HDR, and fixes a latent sampler-name bug in the gamma post-process shader.

Verified on Pixel 7a (broken) and Samsung A50 (reference); both now emit BT.709 SDR with matching pixels and ~30 fps recording.

2. RVCCA build guard
createLocalGPSAnchor is defined outside any #if RVCCA_AVAILABLE block but dereferences a forward-declared type. Breaks any build without libreactvisioncca headers present (public CI included). All call sites are already guarded; wraps the definition to match.

tadjik1 added 2 commits April 22, 2026 13:14
The encoder-input EGL surface was declared as sRGB, causing Tensor/Mali
drivers to gamma-linearize every framebuffer write and the encoder to
emit color_transfer=iec61966-2-1 on the MP4. The result: mis-tagged
pixels unrepairable by remux, and GPU throughput throttled to ~10 fps
on Mali-G710. Exynos devices ignored the flag and worked by accident.

Drop the EGL_GL_COLORSPACE_SRGB_KHR attribute; the encoder now emits
BT.709 SDR consistently across SoCs and per-write gamma is gone.

Under VROColorRenderingMode::Linear (HDR) the scene framebuffer holds
linear RGB values that used to rely on the driver's implicit gamma
from the dropped flag. Run the existing gamma post-process explicitly
on the recording path for that mode; non-linear mode blits through.

Fix a dormant bug in the gamma post-process while there: the samplers
list named "hdr_texture" but the shader sampled from "srgb_texture",
leaving the sampler unbound and producing black frames. The recording
path is the first caller to exercise it in HDR.
The function takes a ReactVisionCCA::RVCCAGeospatialProvider* and
dereferences it to call computeArPosition, but RVCCAGeospatialProvider
is only forward-declared when RVCCA_AVAILABLE=0, so the definition
fails to compile in any build without the proprietary libreactvisioncca
headers present. All call sites are already inside #if RVCCA_AVAILABLE
blocks; wrap the definition to match.
@doranteseduardo doranteseduardo self-requested a review April 27, 2026 17:38
@doranteseduardo doranteseduardo merged commit c4b7a22 into ReactVision:main Apr 27, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants